package models

import (
	"gorm.io/gorm"
	"time"
)

type Video struct {
	ID          int    `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT;comment:主键id" json:"id"`
	UserId      int    `gorm:"column:user_id;type:int(11);comment:用户id;NOT NULL" json:"user_id"`
	Description string `gorm:"column:description;type:varchar(255);comment:作品描述;NOT NULL" json:"description"`
	FileName    string `gorm:"column:file_name;type:varchar(255);comment:视频文件url地址;NOT NULL" json:"file_name"`
	CoverName   string `gorm:"column:cover_name;type:varchar(255);comment:封面url地址;NOT NULL" json:"cover_name"`
	Status      int    `gorm:"column:status;type:int(5);comment:状态;NOT NULL" json:"status"`
	JobId       string `gorm:"column:job_id;type:varchar(100);comment:任务ID" json:"job_id"`
	gorm.Model
}

type VideoEsDocument struct {
	ID          int
	UserId      int
	Description string
	Keywords    []string
	CreatedAt   time.Time
	UpdatedAt   time.Time
}

func init() {
	//if err := database.Client.AutoMigrate(&Video{}); err != nil {
	//	// TODO: skip
	//}
}
